<template>
  <DetailsFormBox :title="dataInfo?.table?.title" :form="data.form" :btns="dataInfo?.details?.btns"
    :formSet='dataInfo?.details?.formSet' :style="dataInfo?.details?.style" :loading="data.loading" :json="dataInfo">
  </DetailsFormBox>
</template>
<script setup lang="ts">
import { useListComponent } from '../pageTs'; // 引入逻辑
const { dataInfo } = useListComponent();
import { reactive, onMounted, getCurrentInstance } from 'vue';
const { proxy } = getCurrentInstance() as any;
const data = reactive({
  loading: true,
  form: {
    dicValueID: '',
    dictionaryCode: '',
    dicValueCode: '',
    displayValue: '',
    dicValue: '',
    dicValueDesc: '',
    dicValueSort: '',
    dicValueState: '',
    dicValueStateName: '',
  },
});
import { useRoute } from 'vue-router';
// 获取当前路由对象
const route = useRoute();
const getForm = () => {
  let _query: any = route.query
  let _form: any = data.form
  if (_query && Object.keys(_query).length > 0) {
    for (let key in _form) {
      _form[key] = route.query[key];
    }
  }
  data.loading = false
};

onMounted(() => {
  getForm();
});
</script>
